package org.travel.app.controller;
import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.travel.app.common.vo.ResultVO;
import org.travel.app.entity.spots.Spots;
import org.travel.app.service.impl.SpotsServiceImpl;

/**
 * @author nmm
 * @date 2024-12-2024/12/11
 * @deriction njm......
 */
@RestController
@RequestMapping("/spots")
@RequiredArgsConstructor
@Slf4j
public class SpotsController extends BaseController{
private final SpotsServiceImpl spotsService;

@PostMapping("/getSpotsList/{pageNum}/{pageSize}")
public ResultVO getSpotsList(@PathVariable("pageNum") int pageNum,@PathVariable("pageSize") int pageSize,@RequestBody Spots spots ) {
    PageInfo<Spots> spotsList = spotsService.getSpotsList(pageNum, pageSize,spots);
    return success(spotsList);
}

@PostMapping("/getSpotsById")
public ResultVO getSpotsById(@RequestBody Spots spots) {
    return success(spotsService.getSpotById(spots.getSpotId()));
}


}